/**
 * @author hanzc
 * @date 2021-01-22
 */

const {mock} = require('mockjs');
const valuesOne = require('./json/generalView/valuesOne.json');
const partOne = require('./json/generalView/partOne.json');
const detailOne = require('./json/generalView/detailOne.json');
// const partTwo = require('./json/generalView/partTwo.json');
// const detailTwo = require('./json/generalView/detailTwo.json');
const partTwo = {
    code: 0,
    data: {
        generalViewPartOne: null,
        generalViewPartTwo: null,
        generalViewPartThree: null,
        generalViewPartFour: null,
        generalViewPartFive: null,
        generalViewPartSix: {
            cardList: null,
            lineUnit: null,
            barUnit: null,
            compositeUnit: [
                {
                    unitId: 'generalViewTwoPart_partOne_composite_3',
                    unitName: '实际转化',
                    config: {
                        dimensionList: [
                            {
                                dimensionId:
                                    'generalViewTwoPart_partOne_department',
                                dimensionName: 'department',
                                dimensionCname: '学部'
                            }
                        ],
                        measureList: [],
                        compositeMeasureList: [
                            {
                                compositeMeasureId:
                                    'generalViewTwoPart_partOne_actual_group_effect',
                                compositeMeasureName: 'actual_group_effect',
                                compositeMeasureCname: '实际群效'
                            },
                            {
                                compositeMeasureId:
                                    'generalViewTwoPart_partOne_actual_conversion_rate',
                                compositeMeasureName: 'actual_conversion_rate',
                                compositeMeasureCname: '实际转化率'
                            }
                        ],
                        drilling: 0
                    },
                    chart: {
                        legend: {data: ['实际群效', '实际转化率']},
                        xAxis: [
                            {
                                type: 'category',
                                data: [
                                    '小学专题课',
                                    '小学系统班',
                                    '初中',
                                    '高中'
                                ]
                            }
                        ],
                        yAxis: [{type: 'value', name: '实际群效/实际转化率'}],
                        series: [
                            {
                                name: '实际群效',
                                type: 'line',
                                data: [
                                    {name: '小学专题课', value: '303.9927'},
                                    {name: '小学系统班', value: '57.4167'},
                                    {name: '初中', value: '91.8994'},
                                    {name: '高中', value: '99.6935'}
                                ]
                            },
                            {
                                name: '实际转化率',
                                type: 'line',
                                data: [
                                    {name: '小学专题课', value: '0.0'},
                                    {name: '小学系统班', value: '0.0338'},
                                    {name: '初中', value: '0.0528'},
                                    {name: '高中', value: '0.0348'}
                                ]
                            }
                        ]
                    }
                },
                {
                    unitId: 'generalViewTwoPart_partOne_composite_1',
                    unitName: '各学部目标完成度',
                    config: {
                        dimensionList: [
                            {
                                dimensionId:
                                    'generalViewTwoPart_partOne_department',
                                dimensionName: 'department',
                                dimensionCname: '学部'
                            }
                        ],
                        measureList: [],
                        compositeMeasureList: [
                            {
                                compositeMeasureId:
                                    'generalViewTwoPart_partOne_conversion_completion',
                                compositeMeasureName: 'conversion_completion',
                                compositeMeasureCname: '转化完成度'
                            },
                            {
                                compositeMeasureId:
                                    'generalViewTwoPart_partOne_flow_completion',
                                compositeMeasureName: 'flow_completion',
                                compositeMeasureCname: '流量完成度'
                            },
                            {
                                compositeMeasureId:
                                    'generalViewTwoPart_partOne_revenue_completion',
                                compositeMeasureName: 'revenue_completion',
                                compositeMeasureCname: '收入完成度'
                            }
                        ],
                        drilling: 0
                    },
                    chart: {
                        legend: {
                            data: ['转化完成度', '流量完成度', '收入完成度']
                        },
                        xAxis: [
                            {
                                type: 'category',
                                data: [
                                    '小学专题课',
                                    '小学系统班',
                                    '初中',
                                    '高中'
                                ]
                            }
                        ],
                        yAxis: [
                            {
                                type: 'value',
                                name: '转化完成度/流量完成度/收入完成度'
                            }
                        ],
                        series: [
                            {
                                name: '转化完成度',
                                type: 'bar',
                                data: [
                                    {name: '小学专题课', value: '1.7524'},
                                    {name: '小学系统班', value: '0.7101'},
                                    {name: '初中', value: '1.2336'},
                                    {name: '高中', value: '0.75'}
                                ]
                            },
                            {
                                name: '流量完成度',
                                type: 'bar',
                                data: [
                                    {name: '小学专题课', value: '0.7959'},
                                    {name: '小学系统班', value: '1.3202'},
                                    {name: '初中', value: '1.1238'},
                                    {name: '高中', value: '1.1404'}
                                ]
                            },
                            {
                                name: '收入完成度',
                                type: 'bar',
                                data: [
                                    {name: '小学专题课', value: '1.3947'},
                                    {name: '小学系统班', value: '0.7308'},
                                    {name: '初中', value: '0.8903'},
                                    {name: '高中', value: '0.6718'}
                                ]
                            }
                        ]
                    }
                },
                {
                    unitId: 'generalViewTwoPart_partOne_composite_2',
                    unitName: '实际流量与收入',
                    config: {
                        dimensionList: [
                            {
                                dimensionId:
                                    'generalViewTwoPart_partOne_department',
                                dimensionName: 'department',
                                dimensionCname: '学部'
                            }
                        ],
                        measureList: [
                            {
                                measureId:
                                    'generalViewTwoPart_partOne_transform_price',
                                measureName: 'transform_price',
                                isValue: null,
                                measureCname: '实际转化金额'
                            },
                            {
                                measureId:
                                    'generalViewTwoPart_partOne_student_count',
                                measureName: 'student_count',
                                isValue: null,
                                measureCname: '实际学生数'
                            }
                        ],
                        compositeMeasureList: [],
                        drilling: 0
                    },
                    chart: {
                        legend: {data: ['实际转化金额', '实际学生数']},
                        xAxis: [
                            {
                                type: 'category',
                                data: [
                                    '小学专题课',
                                    '小学系统班',
                                    '初中',
                                    '高中'
                                ]
                            }
                        ],
                        yAxis: [
                            {type: 'value', name: '实际转化金额/实际学生数'}
                        ],
                        series: [
                            {
                                name: '实际转化金额',
                                type: 'bar',
                                data: [
                                    {name: '小学专题课', value: '355651396'},
                                    {name: '小学系统班', value: '144759036'},
                                    {name: '初中', value: '307566631'},
                                    {name: '高中', value: '256533390'}
                                ]
                            },
                            {
                                name: '实际学生数',
                                type: 'bar',
                                data: [
                                    {name: '小学专题课', value: '1169934.0'},
                                    {name: '小学系统班', value: '2521200.0'},
                                    {name: '初中', value: '3346776.0'},
                                    {name: '高中', value: '2573221.0'}
                                ]
                            }
                        ]
                    }
                }
            ],
            pieUnit: null,
            textList: [
                {
                    unitId: 'generalViewTwoPart_partOne_text_1',
                    unitName: '文本',
                    textContent:
                        '目标完成度看板说明\n\n1.在不筛选任何条件时，目标完成度代表“本月总体目标完成情况”\n2.筛选“期名",则目标完成度为某期的目标完成情况\n3.筛选"班级类型"，可浏览文曲星，训练营的目标完成情况\n4.筛选“辅导老师地区”，可查看分中心月目标完成情况'
                }
            ],
            picture: null,
            simpleExcel: null,
            excelList: null
        },
        generalViewTitle: null
    },
    msg: 'success',
    pager: null
};

module.exports = {
    'POST /api/generalView/select': mock({
        code: 0,
        msg: null,
        data: ['aaaa', 'bbbbb', 'cccc'],
        pager: {
            pageNum: 1,
            pageSize: 50,
            count: 100
        }
    }),
    // 'POST /api/generalView/valuesOne': mock(partOne),
    'POST /api/generalView/valuesOne': mock(partOne),
    'POST /api/generalView/DetailOne': mock({
        code: 0,
        msg: null,
        data: detailOne,
        pager: {
            pageNum: 1,
            pageSize: 50,
            count: 100
        }
    }),
    'POST /api/generalView/valuesTwo': mock(partTwo),
    'POST /api/generalView/DetailTwo': mock({
        code: 0,
        msg: null,
        data: detailOne,
        pager: {
            pageNum: 1,
            pageSize: 50,
            count: 100
        }
    })
};
